from django.db import models


class Banner(models.Model):
    title = models.CharField(max_length=256, default="", verbose_name="标题")
    img_url = models.CharField(max_length=512, default="", verbose_name="图片URL")
    link = models.CharField(max_length=512, default="", verbose_name="链接")
    is_deleted = models.BooleanField(default=False, verbose_name="已删除")
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    update_time = models.DateTimeField(auto_now=True, verbose_name="更新时间")

    class Meta:
        verbose_name = "轮播图"
        verbose_name_plural = "轮播图"

    def __str__(self):
        return self.title
